package tom.spring.cloud.amqp.rabbitmq.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 监听topic.
 * @author ZHUFEIFEI
 */
@Slf4j
@Component
public class TopicListener {

    @RabbitListener(queues = "topic.message")
    public void receive1(String msg) {
        log.info("receive1 topic msg : {}", msg);
    }

    @RabbitListener(queues = "topic.messages")
    public void receive2(Message msg) {
        log.info("receive2 topic msg s : {}", msg);
    }
}
